#{extends 'main.html' /}
#{if event.sprint}
<h2>
	<a style ="color:#400040;" href=" @{Projects.showProject(event.sprint.project.getEntityId())}">${event.sprint.project.name}</a> > 
	<a style ="color:#400040;" href=" @{Events.showSprints(event.sprint.project.getEntityId())}">Sprints</a> > 
	<a style ="color:#400040;" href="@{Events.showSprint(event.sprint.getEntityId())}">${event.sprint.name}</a> > 
	<a style ="color:#400040;" href="@{Events.showSprintEvents(event.sprint.getEntityId())}">Events</a> > 
	<a style ="color:#400040;" href="@{Events.showSprint(event.sprint.getEntityId())}">${event.name}</a> >
	User Stories
</h2><hr/>
#{/if}
#{else}
<h2>
	<a style ="color:#400040;" href="@{Projects.showProject(event.project.getEntityId())}">${event.project.name}</a> > 
	<a style ="color:#400040;" href="@{Events.showProjectEvents(event.project.getEntityId())}">Events</a> > 
	<a style ="color:#400040;" href="@{Events.showEvent(event.getEntityId())}">${event.name}</a> >
	User Stories
</h2><hr/>
#{/else}
<h3>Associate User Stories</h3>
#{form @Events.associateStoriesToEvent(event.getEntityId()), id:'form'}
#{if oldStories || newStories}
	#{list items:oldStories, as:'story'}
		&nbsp;&nbsp;<input name = "storiesIds" id = "storiesIds" type = "checkbox" checked="checked" value = "${story.getEntityId()}" /> ${story.story}<br/><br/>
	#{/list}
	#{list items:newStories, as:'story'}
		&nbsp;&nbsp;<input name = "storiesIds" id = "storiesIds" type = "checkbox" value = "${story.getEntityId()}" /> ${story.story}<br/><br/>
	#{/list}
	<input type="submit" value="Submit"/>
#{/if}
#{else}
	&nbsp;&nbsp;There are no user stories in this project!!
#{/else}
#{/form}
